<?php
//    echo "<pre>";
//    print_r($activities);
//    echo "</pre>";
?>

<div class="fluid">
    <div class="span5" style="float: right;">
        <div class="widget">
            <div class="title"><?= image_tag('icons/color/chart.png', array("class" => "titleIcon")); ?><h6>Statistics</h6></div>
            <div class="wInvoice">
                <ul>
                    <li><h4 class="red">$<?= number_format($balance['due']+$customer['old_balance'], 2) ?></h4><span>Due Amount</span></li>
                    <li><h4 class="green">$<?= number_format($balance['paid'], 2) ?></h4><span>Paid Amount</span></li>
                    <li><h4 class="blue">$<?= number_format($balance['due']+$customer['old_balance'] - $balance['paid'], 2) ?></h4><span>Balance</span></li>
                </ul>
                <div class="content">
                    <div class="contentProgress"><div id="bar5" class="barG tipN" title="<?= ($balance['due']) ? number_format(($balance['paid'] / ($balance['due']+$customer['old_balance'])) * 100) : 0 ?>%"></div></div>

                    <ul class="ruler">
                        <li>0</li>
                        <li class="textC">50%</li>
                        <li class="textR">100%</li>
                    </ul>

                    <div class="invButtons">
                        <a style="margin-top: 12px;float: left;" class="sButton sGreen" title="" href="javascript:void(0);" onClick="addInvoice();"><?= image_tag('icons/sPlus.png'); ?><span>Add new invoice</span></a>
                        <a style="margin-top: 12px;float: right;" class="sButton sBlue" title="" href="javascript:void(0);" onClick="addCollection();"><?= image_tag('icons/sPlus.png'); ?><span>Add new Collection</span></a>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="span6" style="float: left;" id="customerDiv">
        <?php include_partial('customer', array('customer' => $customer)) ?>
    </div>

<div class="span6" style="float: left;" id="contactDiv">
    <?php include_partial('contacts', array('contacts' => $contacts)) ?>
</div>

<div class="span5" style="float: right;" id="activityDiv">
    <?php include_partial('activities', array('activities' => $activities)) ?>
</div>



</div>